package com.cjw.controller.person;

import com.cjw.config.annotation.OperationLogAnnotation;
import com.cjw.pojo.dto.database.PageDTO;
import com.cjw.pojo.dto.livesquare.LiveSharingDTO;
import com.cjw.pojo.dto.soulread.ReadCollectionDTO;
import com.cjw.service.person.ShareCollectionService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @create_time: 2021.12.8
 * @author : cjw
 */
@RestController
@RequestMapping("/user/collection")
@Api("我的收藏资源")
public class CollectionController {
    @Autowired
    private ShareCollectionService shareService;


    @PostMapping("/findAllLiveSharing")
    @ApiOperation("查看全部生活分享")
    @OperationLogAnnotation(operModul = "个人中心模块-个人收藏",operType = "查看全部生活分享",operDesc = "查询")
    public List<LiveSharingDTO> findAllLiveSharing(Integer page, Integer size) {
        return shareService.findAllLiveSharing(page,size);
    }

    @PostMapping("/findAllRead")
    @ApiOperation("查看全部朗读")
    @OperationLogAnnotation(operModul = "个人中心模块-个人收藏",operType = "查看全部朗读",operDesc = "查询")
    public PageDTO<List<ReadCollectionDTO>> findAllRead(Integer page, Integer size) {
        return shareService.findAllCollectionRead(page,size);
    }
}
